/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "scintborganism")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Scintborganism.findAll", query = "SELECT s FROM Scintborganism s"),
    @NamedQuery(name = "Scintborganism.findByScintborganismid", query = "SELECT s FROM Scintborganism s WHERE s.scintborganismid = :scintborganismid"),
    @NamedQuery(name = "Scintborganism.findByNombre", query = "SELECT s FROM Scintborganism s WHERE s.nombre = :nombre"),
    @NamedQuery(name = "Scintborganism.findByReprlegal", query = "SELECT s FROM Scintborganism s WHERE s.reprlegal = :reprlegal"),
    @NamedQuery(name = "Scintborganism.findByRuc", query = "SELECT s FROM Scintborganism s WHERE s.ruc = :ruc"),
    @NamedQuery(name = "Scintborganism.findByDireccion", query = "SELECT s FROM Scintborganism s WHERE s.direccion = :direccion"),
    @NamedQuery(name = "Scintborganism.findByTelefono1", query = "SELECT s FROM Scintborganism s WHERE s.telefono1 = :telefono1"),
    @NamedQuery(name = "Scintborganism.findByTelefono2", query = "SELECT s FROM Scintborganism s WHERE s.telefono2 = :telefono2"),
    @NamedQuery(name = "Scintborganism.findByTelefono3", query = "SELECT s FROM Scintborganism s WHERE s.telefono3 = :telefono3"),
    @NamedQuery(name = "Scintborganism.findByFax", query = "SELECT s FROM Scintborganism s WHERE s.fax = :fax"),
    @NamedQuery(name = "Scintborganism.findByWeb", query = "SELECT s FROM Scintborganism s WHERE s.web = :web"),
    @NamedQuery(name = "Scintborganism.findByLatitud", query = "SELECT s FROM Scintborganism s WHERE s.latitud = :latitud"),
    @NamedQuery(name = "Scintborganism.findByPuntocardlat", query = "SELECT s FROM Scintborganism s WHERE s.puntocardlat = :puntocardlat"),
    @NamedQuery(name = "Scintborganism.findByLongitud", query = "SELECT s FROM Scintborganism s WHERE s.longitud = :longitud"),
    @NamedQuery(name = "Scintborganism.findByPuntocardlon", query = "SELECT s FROM Scintborganism s WHERE s.puntocardlon = :puntocardlon"),
    @NamedQuery(name = "Scintborganism.findByEvaluacion", query = "SELECT s FROM Scintborganism s WHERE s.evaluacion = :evaluacion"),
    @NamedQuery(name = "Scintborganism.findByEmail", query = "SELECT s FROM Scintborganism s WHERE s.email = :email"),
    @NamedQuery(name = "Scintborganism.findByFecharegistro", query = "SELECT s FROM Scintborganism s WHERE s.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Scintborganism.findByObservaciones", query = "SELECT s FROM Scintborganism s WHERE s.observaciones = :observaciones")})
public class Scintborganism implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "scintborganismid")
    private Integer scintborganismid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "reprlegal")
    private String reprlegal;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 13)
    @Column(name = "ruc")
    private String ruc;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "direccion")
    private String direccion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "telefono1")
    private String telefono1;
    @Size(max = 10)
    @Column(name = "telefono2")
    private String telefono2;
    @Size(max = 10)
    @Column(name = "telefono3")
    private String telefono3;
    // @Pattern(regexp="^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message="Invalid phone/fax format, should be as xxx-xxx-xxxx")//if the field contains phone or fax number consider using this annotation to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "fax")
    private String fax;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 400)
    @Column(name = "web")
    private String web;
    @Basic(optional = false)
    @NotNull
    @Column(name = "latitud")
    private int latitud;
    @Basic(optional = false)
    @NotNull
    @Column(name = "puntocardlat")
    private char puntocardlat;
    @Basic(optional = false)
    @NotNull
    @Column(name = "longitud")
    private int longitud;
    @Basic(optional = false)
    @NotNull
    @Column(name = "puntocardlon")
    private char puntocardlon;
    @Basic(optional = false)
    @NotNull
    @Column(name = "evaluacion")
    private boolean evaluacion;
    // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 400)
    @Column(name = "email")
    private String email;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Size(max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scintborganismid")
    private Collection<Scaltbareainve> scaltbareainveCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scintborganismid")
    private Collection<Scittbfadece> scittbfadeceCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scintborganismid")
    private Collection<Sccntbconvorg> sccntbconvorgCollection;
    @JoinColumn(name = "scintbtiporganid", referencedColumnName = "scintbtiporganid")
    @ManyToOne(optional = false)
    private Scintbtiporgan scintbtiporganid;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "revisionparesid")
    private Collection<Pydgtbproyec> pydgtbproyecCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scintborganismid")
    private Collection<Scrvtbrevista> scrvtbrevistaCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scintborganismid")
    private Collection<Pydgtbinvanual> pydgtbinvanualCollection;

    public Scintborganism() {
    }

    public Scintborganism(Integer scintborganismid) {
        this.scintborganismid = scintborganismid;
    }

    public Scintborganism(Integer scintborganismid, String nombre, String reprlegal, String ruc, String direccion, String telefono1, String fax, String web, int latitud, char puntocardlat, int longitud, char puntocardlon, boolean evaluacion, String email, Date fecharegistro) {
        this.scintborganismid = scintborganismid;
        this.nombre = nombre;
        this.reprlegal = reprlegal;
        this.ruc = ruc;
        this.direccion = direccion;
        this.telefono1 = telefono1;
        this.fax = fax;
        this.web = web;
        this.latitud = latitud;
        this.puntocardlat = puntocardlat;
        this.longitud = longitud;
        this.puntocardlon = puntocardlon;
        this.evaluacion = evaluacion;
        this.email = email;
        this.fecharegistro = fecharegistro;
    }

    public Integer getScintborganismid() {
        return scintborganismid;
    }

    public void setScintborganismid(Integer scintborganismid) {
        this.scintborganismid = scintborganismid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getReprlegal() {
        return reprlegal;
    }

    public void setReprlegal(String reprlegal) {
        this.reprlegal = reprlegal;
    }

    public String getRuc() {
        return ruc;
    }

    public void setRuc(String ruc) {
        this.ruc = ruc;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public String getTelefono1() {
        return telefono1;
    }

    public void setTelefono1(String telefono1) {
        this.telefono1 = telefono1;
    }

    public String getTelefono2() {
        return telefono2;
    }

    public void setTelefono2(String telefono2) {
        this.telefono2 = telefono2;
    }

    public String getTelefono3() {
        return telefono3;
    }

    public void setTelefono3(String telefono3) {
        this.telefono3 = telefono3;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getWeb() {
        return web;
    }

    public void setWeb(String web) {
        this.web = web;
    }

    public int getLatitud() {
        return latitud;
    }

    public void setLatitud(int latitud) {
        this.latitud = latitud;
    }

    public char getPuntocardlat() {
        return puntocardlat;
    }

    public void setPuntocardlat(char puntocardlat) {
        this.puntocardlat = puntocardlat;
    }

    public int getLongitud() {
        return longitud;
    }

    public void setLongitud(int longitud) {
        this.longitud = longitud;
    }

    public char getPuntocardlon() {
        return puntocardlon;
    }

    public void setPuntocardlon(char puntocardlon) {
        this.puntocardlon = puntocardlon;
    }

    public boolean getEvaluacion() {
        return evaluacion;
    }

    public void setEvaluacion(boolean evaluacion) {
        this.evaluacion = evaluacion;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Scaltbareainve> getScaltbareainveCollection() {
        return scaltbareainveCollection;
    }

    public void setScaltbareainveCollection(Collection<Scaltbareainve> scaltbareainveCollection) {
        this.scaltbareainveCollection = scaltbareainveCollection;
    }

    @XmlTransient
    public Collection<Scittbfadece> getScittbfadeceCollection() {
        return scittbfadeceCollection;
    }

    public void setScittbfadeceCollection(Collection<Scittbfadece> scittbfadeceCollection) {
        this.scittbfadeceCollection = scittbfadeceCollection;
    }

    @XmlTransient
    public Collection<Sccntbconvorg> getSccntbconvorgCollection() {
        return sccntbconvorgCollection;
    }

    public void setSccntbconvorgCollection(Collection<Sccntbconvorg> sccntbconvorgCollection) {
        this.sccntbconvorgCollection = sccntbconvorgCollection;
    }

    public Scintbtiporgan getScintbtiporganid() {
        return scintbtiporganid;
    }

    public void setScintbtiporganid(Scintbtiporgan scintbtiporganid) {
        this.scintbtiporganid = scintbtiporganid;
    }

    @XmlTransient
    public Collection<Pydgtbproyec> getPydgtbproyecCollection() {
        return pydgtbproyecCollection;
    }

    public void setPydgtbproyecCollection(Collection<Pydgtbproyec> pydgtbproyecCollection) {
        this.pydgtbproyecCollection = pydgtbproyecCollection;
    }

    @XmlTransient
    public Collection<Scrvtbrevista> getScrvtbrevistaCollection() {
        return scrvtbrevistaCollection;
    }

    public void setScrvtbrevistaCollection(Collection<Scrvtbrevista> scrvtbrevistaCollection) {
        this.scrvtbrevistaCollection = scrvtbrevistaCollection;
    }

    @XmlTransient
    public Collection<Pydgtbinvanual> getPydgtbinvanualCollection() {
        return pydgtbinvanualCollection;
    }

    public void setPydgtbinvanualCollection(Collection<Pydgtbinvanual> pydgtbinvanualCollection) {
        this.pydgtbinvanualCollection = pydgtbinvanualCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scintborganismid != null ? scintborganismid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scintborganism)) {
            return false;
        }
        Scintborganism other = (Scintborganism) object;
        if ((this.scintborganismid == null && other.scintborganismid != null) || (this.scintborganismid != null && !this.scintborganismid.equals(other.scintborganismid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Scintborganism[ scintborganismid=" + scintborganismid + " ]";
    }
    
}
